﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="ListMonthSupply.aspx.cs" Inherits="lcs.Web.supply.ListMonthSupply" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
    <script src="../Scripts/JsTools.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#txt_projectName").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../Handler.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { label: item.projectName + item.proid, value: item.projectName };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 <table cellpadding="0" cellspacing="0" class="style1">
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
        <tr>
            <td style=" height:15px;">
                <b>发货前质量确认当月供应计划列表</b></td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:left"><b>本月供应计划截止日期</b>：<asp:Label ID="lbl_resultDate" runat="server" Text=""></asp:Label>
                &nbsp;</td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:left">&nbsp;</td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:left"> 项目名称：<asp:TextBox ID="txt_projectName" runat="server"></asp:TextBox>
&nbsp; 物料描述：<asp:TextBox ID="txt_material" runat="server"></asp:TextBox>
&nbsp;<asp:Button ID="btn_sel" runat="server" CssClass="btn" onclick="btn_sel_Click" 
                    Text="查询" /></td>
        </tr>
        <tr>
            <td style=" height:15px; text-align:left">&nbsp;</td>
        </tr>
        <tr>
            <td style=" height:15px;">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"
                    onrowcommand="GridView1_RowCommand" Width="100%" AllowPaging="True" 
                    onpageindexchanging="GridView1_PageIndexChanging" OnRowDataBound="GridView1_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:LinkButton ID="lbn_confirmFrist" runat="server" 
                                    CommandArgument='<%# Bind("monthSupplyPlanId") %>' 
                                    CommandName="lbn_confirmFrist" ForeColor="Blue">发货前质量确认</asp:LinkButton>
                                &nbsp;
                            </ItemTemplate>
                        </asp:TemplateField>
<asp:BoundField DataField="supplyDate" HeaderText="供应年月" DataFormatString="{0:d}"></asp:BoundField>
                        <asp:BoundField DataField="proid" HeaderText="项目编号" />
                        <asp:BoundField DataField="projectName" HeaderText="项目名称" />
                        <asp:BoundField DataField="material" HeaderText="物料描述" />
                        <asp:BoundField DataField="thisMonthCount" HeaderText="本月计划数量" />
                        <asp:BoundField DataField="innums" HeaderText="已入库数量" />
                        <asp:BoundField DataField="arrivalAddress" HeaderText="到货地点" />
                        <asp:BoundField DataField="linkman" HeaderText="联系人" />
                        <asp:BoundField DataField="contactWay" HeaderText="联系方式" />
                    </Columns>
                     <PagerStyle CssClass="mypager" />
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td style=" height:15px;">
                &nbsp;</td>
        </tr>
        </table>
</asp:Content>
